<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 300px;
      height: 100px;

      background: linear-gradient(-45deg,red 33.333%, green 33.33%,green 66.6666%,blue 66.666%)
      /* background: linear-gradient(to bottom,red 33.333%, green 33.33%,green 66.6666%,blue 66.666%) */
    }
  </style>
</head>

<body>
  // 浏览器内核
  // moz=== 火狐
  // o===== 欧朋
  // webkit ===谷歌
  // background:linear-gradient(方向[默认值：从上往下 to bottom],颜色1,颜色2.。。。。。。)
  <div></div>
</body>

</html>